<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Decrement numeric item's value, stored on a specific server</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="memcached.decrement.html">Memcached::decrement</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="memcached.delete.html">Memcached::delete</a></div>
 <div class="up"><a href="class.memcached.html">Memcached</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="memcached.decrementbykey" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Memcached::decrementByKey</h1>
  <p class="verinfo">(PECL memcached &gt;= 2.0.0)</p><p class="refpurpose"><span class="refname">Memcached::decrementByKey</span> &mdash; <span class="dc-title">Decrement numeric item&#039;s value, stored on a specific server</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-memcached.decrementbykey-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span> <span class="methodname"><strong>Memcached::decrementByKey</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$server_key</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$offset</code><span class="initializer"> = 1</span></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$initial_value</code><span class="initializer"> = 0</span></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$expiry</code><span class="initializer"> = 0</span></span>
  ]]] )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>Memcached::decrementByKey()</strong></span> decrements a numeric item&#039;s
   value by the specified <em><code class="parameter">offset</code></em>. If the item&#039;s value
   is not numeric, an error will result. If the operation
   would decrease the value below 0, the new value will be 0.
   <span class="function"><strong>Memcached::decrementByKey()</strong></span> will set the item to the
   <em><code class="parameter">initial_value</code></em> parameter if the key doesn&#039;t exist.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-memcached.decrementbykey-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">server_key</code></em></dt>

     <dd>

      <p class="para">
       本键名用于识别储存和读取值的服务器。没有将实际的键名散列到具体的项目，而是在决定与哪一个 memcached 服务器通信时将其散列为服务器键名。这使得关联的项目在单一的服务上被组合起来以提高多重操作的效率。
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">key</code></em></dt>

     <dd>

      <p class="para">
       The key of the item to decrement.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">offset</code></em></dt>

     <dd>

      <p class="para">
       The amount by which to decrement the item&#039;s value.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">initial_value</code></em></dt>

     <dd>

      <p class="para">
       The value to set the item to if it doesn&#039;t currently exist.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">expiry</code></em></dt>

     <dd>

      <p class="para">
       The expiry time to set on the item.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-memcached.decrementbykey-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns item&#039;s new value on success 或者在失败时返回 <strong><code>FALSE</code></strong>.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-memcached.decrementbykey-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="memcached.decrement.html" class="methodname" rel="rdfs-seeAlso">Memcached::decrement()</a> - 减小数值元素的值</span></li>
    <li class="member"><span class="methodname"><a href="memcached.increment.html" class="methodname" rel="rdfs-seeAlso">Memcached::increment()</a> - 增加数值元素的值</span></li>
    <li class="member"><span class="methodname"><a href="memcached.incrementbykey.html" class="methodname" rel="rdfs-seeAlso">Memcached::incrementByKey()</a> - Increment numeric item's value, stored on a specific server</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="memcached.decrement.html">Memcached::decrement</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="memcached.delete.html">Memcached::delete</a></div>
 <div class="up"><a href="class.memcached.html">Memcached</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
